class Solution {
public:
    int minArray(vector<int>& numbers) {
        if(numbers.size()==0)
            return 0;
        int i=0;
        int j=numbers.size()-1;

        while(i<j)
        {
            int m=(i+j)>>1;

            //最小值在左边
            if(numbers[m]<numbers[j])
            {
                j=m;
            }
            //最小值在右边
            else if(numbers[m]>numbers[j])
            {
                i=m+1;
            }
            //相等没法判断，缩小j
            else
            {
                j--;
            }
        }
        return numbers[i];
    }
};
